<template>
    <div>
        <h2 class="h2"><span>军籍信息表--残疾军人,伤残民兵民工</span></h2>
        <div>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="140px" class="demo-ruleForm qita" id="qita" accept-charset="UTF-8">
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item label="孤老情况：" prop="E020">
                            <el-radio-group v-model="ruleForm.E020">
                                <el-radio label="是"></el-radio>
                                <el-radio label="否"></el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item class="select2" label="供养情况：" prop="E022">
                            <el-select v-model="ruleForm.E022" placeholder="供养情况">
                                <el-option label="分散" value="1"></el-option>
                                <el-option label="集中" value="2"></el-option>
                                <el-option label="无" value="3"></el-option>
                            </el-select>               
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="供养单位：" prop="E023">
                            <el-input v-model="ruleForm.A003" id="E023" placeholder="请输入供养单位"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item>
                        <el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
                        <el-button @click="resetForm('ruleForm')">重置</el-button>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            ruleForm: { //默认数据
                E004:'',//安置日期
                E012:'',//接收时间
                E019:'',//待遇情况
                E020:'',//孤老情况
                E022:'',//供养情况
                E023:'',//供养单位
            },
            rules: {  //规则
                E004: [
                    { type: 'date', required: true, message: '请选择安置日期', trigger: 'change' }
                ],
                E012: [
                    { type: 'date', required: true, message: '请选择接收时间', trigger: 'change' }
                ],
                E019:[
                    { required: true, message: '请选择文化程度', trigger: 'change' }
                ],
                E020:[
                    { required: true, message: '请选择文化程度', trigger: 'change' }
                ],
                E022:[
                    { required: true, message: '请选择文化程度', trigger: 'change' }
                ],
                E023:[
                    { required: true, message: '请选择文化程度', trigger: 'blur' }
                ],
            },
        }
    },
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('成功，tuiyishibing!');
                    console.log(this.ruleForm)
                    this.$emit('submitfn',2)
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
    },
    components:{
        
    }
}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
}
.el-row:last-child {
    margin-bottom: 0;
}
</style>